<?php
	session_start(); 
	include("conf/connect.php");
	$user_name=$_POST['user_name'];
	$password1=$_POST['pass1'];
	$password2=$_POST['pass2'];
	if($user_name==$password1){
		$_SESSION['check']=2;
		header( 'location: changepassword.php');
	}
	elseif($password1==$password2){
		$sql="UPDATE user SET user_passward='$password1' WHERE name='$user_name'";
		mysql_query($sql);
	}
	else{
		$_SESSION['check']=1;
		header( 'location: changepassword.php');
	}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title></title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<link rel="stylesheet" type="text/css" href="style.css" media="screen" />
	<link rel="shortcut icon" href="images/favicon.ico" />
</head>
<body class="iub_back">
	<table align="center" border="0" class="table_border"  >
		<tr>
				<td> 
					Password changed successfully.<br /> 
					<a href="index.php">Click to login</a>
				</td>
		</tr>	
	</table>
</body>
</html>